package com.microservice.api.auth.dto;

import com.microservice.api.user.dto.UserInfoDTO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * 登录响应DTO
 * 包含token、用户信息、角色、权限、菜单
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LoginResponse implements Serializable {
    private static final long serialVersionUID = 1L;
    
    /**
     * JWT Token
     */
    private String token;
    
    /**
     * 用户信息
     */
    private UserInfoDTO userInfo;
    
    /**
     * 用户角色列表
     */
    private Set<String> roles;
    
    /**
     * 用户权限列表
     */
    private Set<String> permissions;
    
    /**
     * 用户菜单树
     */
    private List<MenuVO> menus;
    
    /**
     * 菜单VO
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class MenuVO implements Serializable {
        private static final long serialVersionUID = 1L;
        
        private Long id;
        private String menuName;
        private String menuCode;
        private Long parentId;
        private String menuType;
        private String path;
        private String component;
        private String icon;
        private Integer sortOrder;
        private String permissionCode;
        
        /**
         * 子菜单列表
         */
        private List<MenuVO> children;
    }
}
